package com.test.shiyan3;

import java.util.Scanner;

public class jttl {
    public static void main(String[] args) {
        int m,n;
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入笼中共有m个头:");
        m=sc.nextInt();
        System.out.print("请输入笼中共有n只脚：");
        n=sc.nextInt();
        int j = 0;
        for (int i=0;i<=m;i++){
            j=m-i;
            if (2 * i + 4 * j == n){
                System.out.println("鸡："+i+"，兔子:"+j);
            }
        }
        sc.close();
    }
}
